package icasue.tools.sqlhelper.adaptor.annotation;

import icasue.tools.sqlhelper.adaptor.ibatis.ReflectionSqlProvider;

import java.lang.annotation.*;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2021/11/5 上午11:59
 * @UpdateDate:
 * @Description: 该注解用于描述SqlProvider的自动化信息，兼容 ibatis:[3.5.0 - 3.5.7) 或者更高.
 */
@Target(ElementType.METHOD)
@Repeatable(AutoProvider.List.class)
@Retention(RetentionPolicy.RUNTIME)
public @interface AutoProvider {
    Class<?> type() default ReflectionSqlProvider.class;  // using in ibatis (1.x, 3.5.4]
    String method();                                      // using in ibatis (1.x, 3.5.4]

    Class<?> value() default void.class;                  // using in ibatis (1.x, 3.5.7]
    String databaseId() default "";                       // using in ibatis (1.x, 3.5.7]

    @Retention(RetentionPolicy.RUNTIME)                   // adaptor for ibatis [3.5.5, 3.5.7)
    @Target(ElementType.METHOD)
    @interface List {
        AutoProvider[] value();
    }
}
